const express = require('express')
const app = express()

app.set('secret','123456') // 设置token加密规则

app.use(require('cors')()) //跨域处理
app.use(express.json()) //中间件
app.use('/uploads', express.static(__dirname + '/uploads')) // 静态文件托管

require('./routes/admin')(app) //路由
require('./plugins/db')(app) //数据库

app.listen('3000',() => {
  console.log('http://localhost:3000');
})